package com.miracle.erp.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 注销 doGet
 * @author MARECLE_YING
 * @Date 2021年3月24日
 */
@WebServlet("/logout")
public class LogoutServlet extends HttpServlet {
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
			// 删除session中登陆信息并返回登陆页面  invalidate 使无效，使无价值
			req.getSession().invalidate();
			// 登陆页面
			resp.sendRedirect(req.getContextPath()+"/login.jsp");
	}
}
